package com.itheima.consumer.listener;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @version 1.0
 * @Author lwx
 * @Date 2024/12/27 18:11
 */
@Component
public class DemoListener {

    @RabbitListener(bindings = {
            @QueueBinding(
                    value = @Queue(name = "q1",durable = "false"),
                    exchange = @Exchange(name = "demo.topic",type = ExchangeTypes.TOPIC,durable = "false"),
                    key = "a.#"
            ),
            @QueueBinding(
                    value = @Queue(name = "q2",durable = "false"),
                    exchange = @Exchange(name = "demo.topic",type = ExchangeTypes.TOPIC,durable = "false"),
                    key = "*.*"
            )
    })
    public void init(){

    }

}
